package com.example;

import com.example.entity.Student;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        // 加载Spring配置文件，初始化IOC容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        // 从容器中获取Student对象
        Student student = (Student) context.getBean("student");

        // 输出Student信息
        System.out.println("从Spring容器中获取的Student信息：");
        System.out.println(student);
    }
}